<html>
	<head>
		<meta charset="UTF-8">
		<title>通用定时任务处理</title>
		<!--    <link rel="stylesheet" href="../ftpcss/bootstrap-combined.min.css"/>-->
		<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/HcFtpToFileSystemConfigList.css" />
	</head>
	<body>
		<nav class="navbar navbar-default" role="navigation">
		<div class="container">
			<div class="row">
				<div class="col-md-4">
					<p class="navbar-text">
						<span>位置：</span>
						<a href="https://demo.java110.com">HC平台</a>
						<span class="glyphicon glyphicon-menu-right "
							style="font-size: 6px;"></span>
						<span>通用定时任务处理</span>
					</p>
				</div>
			</div>
		</div>
		</nav>
		<div class="container">
			<div class="row">
				<div class="col-md-3">
					<div class="input-group">
						<input type="text" id="taskName" class="form-control"
							placeholder="请输入任务名称或任务ID">
						<span class="input-group-btn">
							<button class="btn btn-default" type="button" onclick="searchTaskByNameOrId()">
								查询
							</button> </span>
					</div>
				</div>
				<div class="col-md-5">
				</div>
				<div class="col-md-4">
					<div class="col-md-2">
						<button class="btn btn-success" type="button" onclick="startJob()">
							启动
						</button>
					</div>
					<div class="col-md-2">
						<button class="btn btn-danger" type="button" onclick="stopJob()">
							停止
						</button>
					</div>
					<div class="col-md-2">
						<button class="btn btn-primary" type="button" onclick="newTask()">
							新增
						</button>
					</div>
					<div class="col-md-2">
						<button class="btn btn-info" type="button" onclick="editTask()">
							编辑
						</button>
					</div>
					<div class="col-md-2">
						<button class="btn btn-warning" type="button"
							onclick="deleteTask()">
							删除
						</button>
					</div>
				</div>

			</div>

		</div>

		<div class="container" style="margin-top: 20px">
			<table class="table table-bordered table-hover">
				<thead>
					<tr class="active">
						<th class="text-center">
							选择
						</th>
						<th class="text-center">
							任务ID
						</th>
						<th class="text-center">
							任务名称
						</th>
						<th class="text-center">
							运行时间
						</th>
						<th class="text-center">
							传输类型
						</th>
						<th class="text-center">
							创建时间
						</th>
						<th class="text-center">
							运行状态
						</th>
						<th class="text-center">
							启停状态
						</th>
						<th class="text-center">
							线程数
						</th>
						<!--<th class="text-center">
							操作
						</th>-->
					</tr>
				</thead>
				<tbody id="tasksContext">

				</tbody>
			</table>

		</div>
		<!-- 分页 -->
		<div class="container text-center">
			<ul id="saopPagination" class="pagination">
				
			</ul>
		</div>

		<!-- 新增任务模态框（Modal） -->
		<div class="modal fade" id="newTaskModal" tabindex="-1" role="dialog"
			aria-labelledby="newTaskModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-dialog-task">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="newTaskModalLabel">
							新增任务
						</h4>
					</div>
					<div class="modal-body">
						<div class="alert alert-danger alert-dismissible hidden"
							role="alert" aria-hidden="true" id="error_alert_divNew">
							<button type="button" class="close"
								onclick="$('#error_alert_div').attr('class','alert alert-danger alert-dismissible hidden');">
								<span aria-hidden="true">&times;</span>
							</button>
							<strong>校验失败</strong>
							<span id="errorAlertInfoNew"></span>
						</div>
						<div class="row">
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									任务名称：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="taskNameNew"
										id="taskNameNew" placeholder="请输入任务名称" />
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									执行时间：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="taskCronNew"
										id="taskCronNew" placeholder="请输入执行时间，quartz 时间表达式" />
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									线程个数：
								</label>
								<div class="col-md-8">
									<input type="number" class="form-control" name="tNumNew"
										id="tNumNew" placeholder="请输入线程个数" />
								</div>
							</div>
						</div>

						<div class="row">
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									是否空传：
								</label>
								<div class="col-md-8">
									<select class="form-control" name="upNulNew" id="upNulNew">
										<option value="0">
											不需要空传
										</option>
										<option value="1">
											需要空传
										</option>
									</select>
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									告警号码：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="errPhoneNew"
										id="errPhoneNew" placeholder="请输入执行失败时的告警号码" />
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									事前处理：
								</label>
								<div class="col-md-8">
									<select class="form-control" name="preFlagNew" id="preFlagNew">
										<option value="1">
											不需要事前处理
										</option>
										<option value="0">
											需要事前处理
										</option>
									</select>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									事前过程：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="preFunctionNew"
										id="preFunctionNew" placeholder="请输入调用前处理过程名称" />
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									事后处理：
								</label>
								<div class="col-md-8">
									<select class="form-control" name="afterFlagNew"
										id="afterFlagNew">
										<option value="1">
											不需要事后处理
										</option>
										<option value="0">
											需要事后处理
										</option>
									</select>
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									事后过程：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="afterFunctionNew"
										id="afterFunctionNew" placeholder="请输入调用后处理过程名称" />
								</div>
							</div>
						</div>

						<div class="row" id="lastTastInfoDivNew">
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									任务模板：
								</label>
								<div class="col-md-8">
									<select class="form-control" name="uOrDNew" id="uOrDNew"
										onchange="queryTaskAttr(this,'New')">
										<option value="U">
											TFS文件保存至FTP
										</option>
										<option value="DT">
											FTP文件保存至Table
										</option>
									</select>
								</div>
							</div>
							<div class="col-md-8 form-group form-horizontal">
								<label class="col-md-2 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									文件名称：
								</label>
								<div class="col-md-10">
									<textarea class="form-control" id="fileNameNew"
										name="fileNameNew" rows="2"
										placeholder="请输入文件名称支持，时间格式######## sql语句和模糊匹配****"></textarea>
								</div>
							</div>
						</div>


					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">
							关闭
						</button>
						<button type="button" class="btn btn-primary"
							onclick="saveTaskInfo('New')">
							保存
						</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal -->
		</div>



		<!-- 编辑任务模态框（Modal） -->
		<div class="modal fade" id="editTaskModal" tabindex="-1" role="dialog"
			aria-labelledby="editTaskModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-dialog-task">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="editTaskModalLabel">
							编辑任务
						</h4>
					</div>
					<div class="modal-body">
						<div class="alert alert-danger alert-dismissible hidden"
							role="alert" aria-hidden="true" id="error_alert_divEdit">
							<button type="button" class="close"
								onclick="$('#error_alert_div').attr('class','alert alert-danger alert-dismissible hidden');">
								<span aria-hidden="true">&times;</span>
							</button>
							<strong>校验失败</strong>
							<span id="errorAlertInfoEdit"></span>
						</div>
						<input type="hidden" id="taskIdEdit" name="taskIdEdit" value="" />
						<div class="row">
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									任务名称：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="taskNameEdit"
										id="taskNameEdit" placeholder="请输入任务名称" />
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									执行时间：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="taskCronEdit"
										id="taskCronEdit" placeholder="请输入执行时间，quartz 时间表达式" />
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									线程个数：
								</label>
								<div class="col-md-8">
									<input type="number" class="form-control" name="tNumEdit"
										id="tNumEdit" placeholder="请输入线程个数" />
								</div>
							</div>
						</div>

						<div class="row">
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									是否空传：
								</label>
								<div class="col-md-8">
									<select class="form-control" name="upNulEdit" id="upNulEdit">
										<option value="0">
											不需要空传
										</option>
										<option value="1">
											需要空传
										</option>
									</select>
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									告警号码：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="errPhoneEdit"
										id="errPhoneEdit" placeholder="请输入执行失败时的告警号码" />
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									事前处理：
								</label>
								<div class="col-md-8">
									<select class="form-control" name="preFlagEdit"
										id="preFlagEdit">
										<option value="1">
											不需要事前处理
										</option>
										<option value="0">
											需要事前处理
										</option>
									</select>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									事前过程：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control" name="preFunctionEdit"
										id="preFunctionEdit" placeholder="请输入调用前处理过程名称" />
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									事后处理：
								</label>
								<div class="col-md-8">
									<select class="form-control" name="afterFlagEdit"
										id="afterFlagEdit">
										<option value="1">
											不需要事后处理
										</option>
										<option value="0">
											需要事后处理
										</option>
									</select>
								</div>
							</div>
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									事后过程：
								</label>
								<div class="col-md-8">
									<input type="text" class="form-control"
										name="afterFunctionEdit" id="afterFunctionEdit"
										placeholder="请输入调用后处理过程名称" />
								</div>
							</div>
						</div>

						<div class="row" id="lastTastInfoDivEdit">
							<div class="col-md-4 form-group form-horizontal">
								<label class="col-md-4 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									任务模板：
								</label>
								<div class="col-md-8">
									<select class="form-control" name="uOrDEdit" id="uOrDEdit"
										onchange="queryTaskAttr(this,'Edit')">
										<option value="D">
											FTP文件保存至TFS
										</option>
										<option value="U">
											TFS文件保存至FTP
										</option>
										<option value="DT">
											FTP文件保存至Table
										</option>
									</select>
								</div>
							</div>
							<div class="col-md-8 form-group form-horizontal">
								<label class="col-md-2 control-label nopaddingright">
									<span class="glyphicon glyphicon-asterisk required"></span>
									文件名称：
								</label>
								<div class="col-md-10">
									<textarea class="form-control" id="fileNameEdit"
										name="fileNameEdit" rows="2"
										placeholder="请输入文件名称支持，时间格式######## sql语句和模糊匹配****"></textarea>
								</div>
							</div>
						</div>


					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">
							关闭
						</button>
						<button type="button" class="btn btn-primary"
							onclick=
	saveTaskInfo('Edit');
>
							保存
						</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal -->
		</div>

		<!--提示弹框-->
		<div class="modal fade" id="alertModal" tabindex="-1" role="dialog"
			aria-labelledby="alertModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<h4 class="modal-title" id="alertModalLabel">
							温馨提示
						</h4>
					</div>
					<div class="modal-body" id="alertContext"></div>
					<div class="modal-footer modal-center">
						<button type="button" class="btn btn-primary" data-dismiss="modal">
							关闭
						</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal -->
		</div>

		<!--加载效果-->
		<div id="loader" style="display: none;">
			<div id="loading" class="loading">
				正在处理...
			</div>
			<div class="modal-backdrop in "></div>
		</div>
		<!--为了加速度，将js部分放入最后-->
		<script type="text/javascript" src="../js/jquery.min.js"></script>
		<script type="text/javascript" src="../js/bootstrap.min.js"></script>
		<script type="text/javascript" src="../js/bootstrap-paginator.js"></script>
		<script type="text/javascript"
			src="../js/HcFtpToFileSystemConfigList.js"></script>
	</body>
</html>